//
//  UIApplication+Tool.m
//  SLDemo
//
//  Created by bocai on 2016/12/20.
//  Copyright © 2016年 Heracles. All rights reserved.
//

#import "UIApplication+Tool.h"

@implementation UIApplication (Tool)

+ (void)t_openAppStoreWithURLString:(NSString *)urlString
{
    urlString = [@"itms-apps://itunes.apple.com/cn/app/" stringByAppendingString:urlString];
    NSURL *url = [NSURL URLWithString:urlString];
    if ([[UIApplication sharedApplication] canOpenURL:url]) {
        [[UIApplication sharedApplication] openURL:url];
    }
}

+ (void)t_callPhoneNumber:(NSString *)phoneNumber
{
    NSString *urlString = [@"telprompt://" stringByAppendingString:phoneNumber];
    NSURL *url = [NSURL URLWithString:urlString];
    if ([[UIApplication sharedApplication] canOpenURL:url]) {
        [[UIApplication sharedApplication] openURL:url];
    }
}

@end
